import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);

// 给原型函数加一层代理，允许打开相同的菜单，避免重复打开菜单时报错
const routerPush = Router.prototype.push;

Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error)
};


// 静态路由，一些纯前端实现的界面
let default_routes = [
  {
    name: "lock",
    path: '/lock',
    component: () => import('@/view/lock.vue')
  },
  {
    name: "login",
    path: '/login',
    component: () => import('@/view/login.vue')
  },
  {
    name: "index",
    path: '/index',
    component: () => import('@/view/index.vue')
  }
];

let router = new Router({routes: default_routes});
export default router;
